/*
 * 作者:熊猫
 * 日期:2017 - 3 - 15 4 - 17 - 52
 *
 */

package net.lainiao.morethread.Chapter6.demo6;

import java.util.concurrent.ThreadLocalRandom;

/**
 * Created by Administrator on 2017/3/15.
 */
public class TaskLocalRandom implements Runnable {
    public TaskLocalRandom() {
        ThreadLocalRandom.current();
    }

    @Override
    public void run() {
        String name=Thread.currentThread().getName();
        for (int i = 0; i < 10; i++) {
            System.out.println(name+" : "+ThreadLocalRandom.current().nextInt(10));
        }
    }
}
